home *** CD-ROM | disk | FTP | other *** search
/ Wayzata's Best of Shareware for Macintosh / CD Line - Limited Edition Wayzata's Best of Shareware for Macintosh for MacWorld Exposition Milano 1994 (050594)(1994).iso / pc / utilitie / system_7 / hyperkey / hyperkey.1 / stack_-1.xml < prev    next >
Encoding:
Extensible Markup Language  |  1992-05-09  |  11.8 KB  |  20 lines

  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <!DOCTYPE stack PUBLIC "-//Apple, Inc.//DTD stack V 2.0//EN" "" >
  3. <stack>
  4.     <name>in.1</name>
  5.     <id>-1</id>
  6.     <cardCount>1</cardCount>
  7.     <cardID>2870</cardID>
  8.     <listID>4041</listID>
  9.     <cantModify><false /></cantModify>
  10.     <cantDelete><true /></cantDelete>
  11.     <cantAbort><false /></cantAbort>
  12.     <cardSize>
  13.         <width>512</width>
  14.         <height>320</height>
  15.     </cardSize>
  16.     <script>on openstack
  17. global homescript,keynames,SelectedKey,padding,openfile,oldmessage
  18. global OldLevel,CurrentScript,StackOpen,FKeynames
  19. hide titlebar
  20. set cursor to busy
  21. push recent card
  22. put the userlevel into OldLevel
  23. set the userlevel to 5
  24. put the loc of msg into oldmessage
  25. set the loc of msg to 20,17
  26. put "Opening Hyperkeys, please wait ..."
  27. put "A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,"&¬¨
  28. "Open,Backslash,Close,Uparrow,Minus,Space,*,Quote,*,*,*,*,*,*,*,"&¬
  29. "Times,Plus,Comma,KpadMinus,Period,Slash,Zero,One,Two,Three,"&¬
  30. "Four,Five,Six,Seven,Eight,Nine,SemiColon,*,*,Equals,Apostrophe" into keynames
  31. put "One,Two,Three,Four,Five,Six,Seven,Eight,Nine,Ten,Eleven,Twelve,Thirteen,Fourteen,Fifteen" into Fkeynames
  32. put the script of stack "home" into homescript
  33. hide cd fld help
  34. dodialog hide
  35. put "2.1" into cd fld version
  36. put "" into cd fld 1
  37. put "" into cd fld 2
  38. put "" into openfile
  39. put "" into fld "title"
  40. put "" into fld "TheScript"
  41. put "                     " & return into padding
  42. put "Unused Keys" into cd fld "filename"
  43. put "Home" into StackOpen
  44. GetStackInfo
  45. makeHyperkeysMenu
  46. set the hilite of btn "Control Driver" to installed(ControlKey)
  47. set the hilite of btn "FKeys Driver" to installed(FunctionKey)
  48. set the name of button 6 to "Open..."
  49. set the name of button 1 to "Can‚Äôt copy"
  50. set the name of button 2 to "Can‚Äôt copy"
  51. hide btn 1
  52. hide btn 2
  53. hide btn 3
  54. hide btn 4
  55. getInstalledKeys
  56. put "1,1," into selectedkey
  57. hide msg
  58. unlock screen with iris open
  59. end openstack
  60.  
  61. on closestack
  62. global oldmessage,oldlevel
  63. set loc of msg to oldmessage
  64. hide msg
  65. if there is a menu "Hyperkeys" then delete menu "Hyperkeys"
  66. if the freesize of this stack ‚↠0 then domenu "Compact Stack"
  67. set the userlevel to oldlevel
  68. show titlebar
  69. visual iris close
  70. end closestack
  71.  
  72. on suspendstack
  73. global oldmessage,oldlevel
  74. set loc of msg to oldmessage
  75. hide msg
  76. if there is a menu "Hyperkeys" then delete menu "Hyperkeys"
  77. pop card into junk
  78. set the userlevel to oldlevel
  79. end suspendstack
  80.  
  81. on resumestack
  82. global oldmessage,oldlevel
  83. push recent card
  84. put the loc of msg into oldmessage
  85. set the loc of msg to 20,17
  86. hide msg
  87. makeHyperkeysMenu
  88. put the userlevel into oldlevel
  89. set the userlevel to 5
  90. end resumestack
  91.  
  92. function Installed Drivername
  93. global homescript
  94. if offset("on "&DriverName&" keynum",homescript) = 0 then return false
  95. else return true
  96. end Installed
  97.  
  98. on GetInstalledKeys
  99. set cursor to watch
  100. global currentscript,keynames,padding,FKeynames,openfile
  101. put 0 into theTotal
  102. repeat with x = 1 to the number of items in keynames
  103. if item x of keynames = "*" then next repeat
  104. if offset("On docontrol"& item x of keynames&return,currentscript) ‚↠0 then
  105. put "Control ‚Äî " & item x of keynames & padding after cd fld 1
  106. else
  107. if openfile ="" then
  108. add 1 to TheTotal
  109. put "Control ‚Äî " & item x of keynames & padding after cd fld 2
  110. end if
  111. end if
  112. set cursor to busy
  113. end repeat
  114. repeat with x = 1 to the number of items in Fkeynames
  115. if offset("On doFKey"& item x of Fkeynames&return,currentscript) ‚↠0 then
  116. put "Fkey ‚Äî " & item x of Fkeynames & padding after cd fld 1
  117. else
  118. if openfile ="" then
  119. add 1 to theTotal
  120. put "Fkey ‚Äî " & item x of Fkeynames & padding after cd fld 2
  121. end if
  122. end if
  123. set cursor to busy
  124. end repeat
  125. put " available" into Plural
  126. if theTotal ‚↠1 then put "s" before Plural
  127. if openfile = "" then
  128. put TheTotal&&"Key"&Plural into line 2 of cd fld "Filename"
  129. end if
  130. set the scroll of cd fld 2 to 0
  131. set the scroll of cd fld 1 to 0
  132. end GetInstalledKeys
  133.  
  134. on GetScript
  135. global Currentscript,SelectedKey,openfile,Stackopen
  136. put last word of SelectedKey into KeyName
  137. put first word of item 3 of SelectedKey into KeyType
  138. put length(Keyname)+Length(Keytype) into TheLength
  139. if keytype is empty then
  140. put "" into fld "TheScript"
  141. put "" into fld "Title"
  142. hide btn 1
  143. hide btn 2
  144. hide btn 3
  145. hide btn 4
  146. exit GetScript
  147. end if
  148. put "Script of "&Keytype&"-"&keyname into fld title
  149. if item 1 of SelectedKey is 1 then
  150. put offset("On Do"&Keytype&keyname&return,Currentscript) into start
  151. put offset("End Do"&Keytype&keyname&return,Currentscript) into finish
  152. if start = finish then put "" into fld "TheScript"
  153. else
  154. put char (start + thelength +7) to (finish - 2)¬¨
  155. of Currentscript into field "Thescript"
  156. end if
  157. put return&"in"&&line 1 of cd fld "stackName" after fld title
  158. else
  159. if openfile = "" then
  160. put "" into fld "Thescript"
  161. else
  162. open file openfile
  163. put "" into fld "Thescript"
  164. repeat forever
  165. set cursor to busy
  166. read from file openfile until return
  167. if it is "On Do"&Keytype&keyname&return then
  168. repeat forever
  169. set cursor to busy
  170. read from file openfile until return
  171. if it is "End Do"&keytype&keyname&return then
  172. exit repeat
  173. else
  174. put it after fld "TheScript"
  175. end if
  176. end repeat
  177. exit repeat
  178. end if
  179. end repeat
  180. close file openfile
  181. put return&"in" && line 1 of cd fld filename after fld title
  182. end if
  183. end if
  184. end GetScript
  185.  
  186. on UpdateStackScript
  187. global Currentscript,stackopen
  188. put "Writing to "& line 1 of cd fld "Stackname"
  189. set the script of stack stackopen to currentscript
  190. hide msg
  191. end UpdateStackScript
  192.  
  193. on InstallDriver thename
  194. global homescript,keynames
  195. put the script of stack "home" into Homescript
  196. if thename = "Fkey" then put "FunctionKey" into thename
  197. set the cursor to watch
  198. put offset("on "&thename&" keynum",homescript) into start
  199. if start <> 0 then
  200. beep
  201. answer "A "&thename&" driver is already installed"
  202. exit InstallDriver
  203. end if
  204. do "put field "&thename&"Driver into TheDriver"
  205. put "Installing Hyperkeys "&thename&" driver..."
  206. put the short date into word 4 of line 2 of TheDriver
  207. put the time into word 6 of line 2 of TheDriver
  208. if thename = "Controlkey" then
  209. put quote&keynames&quote into word 2 of line 3 of TheDriver
  210. end if
  211. put TheDriver after homescript
  212. set the script of stack "home" to homescript
  213. hide message
  214. end installdriver
  215.  
  216. on RemoveDriver thename
  217. global homescript
  218. put the script of stack "Home" into homescript
  219. if thename = "Fkey" then put "functionkey" into thename
  220. set the cursor to watch
  221. put offset("on "&thename&" keynum",homescript) into start
  222. put offset("end "&thename,homescript) into finish
  223. if start = 0 then
  224. beep
  225. answer "Hyperkeys"&& thename&" driver is not installed"
  226. exit removeDriver
  227. end if
  228. put "Removing Hyperkeys "& thename&" driver..."
  229. put "" into char start to finish + length(thename) +5 of homescript
  230. if thename = "ControlKey" then
  231. put offset("on docontrolH",homescript) into start
  232. put offset("end docontrolH",homescript) into finish
  233. if start ‚↠finish then
  234. put "" into char start to finish +15 of homescript
  235. end if
  236. end if
  237. set the script of stack "home" to homescript
  238. hide message
  239. end RemoveDriver
  240.  
  241. on GetKeysFromFile
  242. global openfile,keynames,padding,FKeynames
  243. open file openfile
  244. read from file openfile for 16384
  245. repeat with x = 1 to the number of lines in it
  246. set cursor to busy
  247. put the number of chars in line x of it into TheLast
  248. if char 1 to 12 of line x of it is "On DoControl" then
  249. put "Control ‚Äî "& char 13 to Thelast of line x of it & padding after cd fld 2
  250. end if
  251. if char 1 to 9 of line x of it is "On DoFkey" then
  252. put "Fkey ‚Äî "& char 10 to Thelast of line x of it & padding after cd fld 2
  253. end if
  254. end repeat
  255. close file openfile
  256. end GetKeysFromFile
  257.  
  258. on GetstackInfo
  259. global StackOpen,CurrentScript
  260. put the script of stack StackOpen into CurrentScript
  261. put round((the size of stack StackOpen)/1024) into TheSize
  262. put round((the FreeSize of stack StackOpen)/1024) into TheFree
  263. put stackopen into thestack
  264. put "Stack"&&quote&quote into cd fld "stackname"
  265. repeat while last char of thestack ‚↠":" and thestack ‚↠empty
  266. put last char of thestack after char 7 of cd fld "stackname"
  267. put "" into last char of thestack
  268. end repeat
  269. put return&TheSize&"K ("&TheFree&"K free)" after cd fld "StackName"
  270. end GetstackInfo
  271.  
  272. on getfileinfo
  273. global openfile
  274. put openfile into thefile
  275. put "File"&&quote&quote into cd fld "filename"
  276. repeat while last char of thefile ‚↠":" and thefile ‚↠empty
  277. put last char of thefile after char 6 of cd fld "filename"
  278. put "" into last char of thefile
  279. end repeat
  280. open file openfile
  281. read from file openfile for 16384
  282. close file openfile
  283. put return &the number of chars in it&" Characters" after cd fld "filename"
  284. end getfileinfo
  285.  
  286. on doCopy
  287. global SelectedKey,CurrentScript,openfile,stackopen
  288. put last word of selectedkey into keyname
  289. put first word of item 3 of selectedkey into KeyType
  290. put length(Keyname)+Length(Keytype) into TheLength
  291. if item 1 of selectedkey is "2" then
  292. put Currentscript into Temp
  293. else
  294. put "" into Temp
  295. open file openfile
  296. read from file openfile for 16384
  297. put it into temp
  298. close file openfile
  299. end if
  300. if last item of selectedkey is in cd fld (3-item 1 of selectedkey) then
  301. answer Keytype&&"-"&&keyname&" already exists ..." with "Replace" or "Cancel"
  302. if it is "Cancel" then
  303. exit docopy
  304. end if
  305. else
  306. put return &"On Do"&Keytype&keyname&return&return&¬¨
  307. "End Do"&Keytype&keyname&return after Temp
  308. end if
  309. put offset("On Do"&keytype&keyname&return,Temp) into start
  310. put offset("End Do"&keytype&keyname&return,Temp) into finish
  311. put fld "TheScript"&return into TheText
  312. if TheText is empty then put return into TheText
  313. put TheText into char start+6+TheLength to finish -1 of Temp
  314. if item 1 of selectedkey = "2" then
  315. put Temp into Currentscript
  316. UpdateStackScript
  317. getstackinfo
  318. else
  319. open file openfile
  320. repeat with x = 1 to the number of lines in Temp
  321. set cursor to busy
  322. write line x of Temp & return to file openfile
  323. end repeat
  324. close file openfile
  325. end if
  326. end docopy
  327.  
  328. on DoDialog DoWhat
  329. put "btn Cover,cd fld dlog,cd fld dlog2,btn OK,btn Cancel," into Itemlist
  330. put "cd fld dlog3,cd fld Action,cd fld Choose" after ItemList
  331. set lockscreen to true
  332. repeat with x =1 to the number of items in itemlist
  333. if DoWhat is "Show" then do "Show "&item x of itemlist
  334. else do "Hide "&item x of itemlist
  335. end repeat
  336. set lockscreen to false
  337. end DoDialog
  338.  
  339. On DoControlH
  340. click at the loc of btn "about"
  341. End DoControlH
  342.  
  343. on makeHyperkeysMenu
  344. if there is a menu "Hyperkeys" then exit makeHyperkeysMenu
  345. create menu "Hyperkeys"
  346. put makeHyperkeysMenuItems() into menu "Hyperkeys" with menuMsg makeHyperkeysMenuMsgs()
  347. disable menuItem 2 of menu "Hyperkeys"
  348. disable menuItem 4 of menu "Hyperkeys"
  349. disable menuItem 5 of menu "Hyperkeys"
  350. disable menuItem 7 of menu "Hyperkeys"
  351. if installed(ControlKey) then
  352. enable menuItem 4 of menu "Hyperkeys"
  353. disable menuItem 3 of menu "Hyperkeys"
  354. end if
  355. if installed(FunctionKey) then
  356. enable menuItem 7 of menu "Hyperkeys"
  357. disable menuItem 6 of menu "Hyperkeys"
  358. end if
  359. end makeHyperkeysMenu
  360.  
  361. function makeHyperkeysMenuItems
  362. return "About Hyperkeys ..." & return & ¬¨
  363. "-" & return & ¬¨
  364. "Install Control Key driver" & return & ¬¨
  365. "Remove Control Key driver" & return & ¬¨
  366. "-" & return & ¬¨
  367. "Install Fkey driver" & return & ¬¨
  368. "Remove Fkey driver" & return
  369. end makeHyperkeysMenuItems
  370.  
  371. function makeHyperkeysMenuMsgs
  372. return "Click at the loc of btn " & quote & "About" & quote & return & ¬¨
  373. "" & return & ¬¨
  374. "Click at loc of btn id 38" & return & ¬¨
  375. "Click at loc of btn id 38" & return & ¬¨
  376. "" & return & ¬¨
  377. "Click at loc of btn id 37" & return & ¬¨
  378. "Click at loc of btn id 37"
  379. end makeHyperkeysMenuMsgs
  380.  
  381. </script>
  382.     <background id="2652" file="background_2652.xml" name="DialogBox" />
  383.     <card id="2870" file="card_2870.xml" marked="false" name="Hyperkeys" owner="2652" />
  384. </stack>
  385.